<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>动画效果</title>
    <style>
        #d1{
            position: absolute;
            width: 200px;
            height: 150px;
            background-color: orange;
            animation: animate 5s infinite alternate;
        }
        @keyframes animate {
            /* from{
                transform: scale(1) translate(0px,0px);
            }
            to{
                transform: scale(3) translate(400px,200px);
            } */
            0%{
                transform: scale(1) translate(0px,0px);
                background-color: greenyellow;
            }
            30%{
                transform: scale(1.5) translate(200px,0px);
                background-color: orange;
            }
            60%{
                transform: scale(1) translate(0px,0px);
                background-color:blueviolet;
            }
            90%{
                transform: scale(1.5) translate(100px,300px);
                background-color:blueviolet;
            }
            100%{
                transform: scale(1) translate(0px,0px);
                background-color:blueviolet;
            }
        }
    </style>
</head>
<body>
    <div id="d1"></div>
</body>
</html>